//
//  ViewController.m
//  16-UICollectionViewCycleImage
//
//  Created by Snow on 16/8/4.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "ViewController.h"
#import "GXCycleImage.h"
#import "MyViewController.h"
@interface ViewController ()<GXDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    /**
     *定时器调研, 添加NSTimer -get
     完善轮播图, 添加pageControl、标题 -get
     轮播图点击方法(自定义协议) - get
     轮播图cell的定制(自定义协议, 在外面修改cell的内容/样式)
     */
    NSArray *title = @[@"噫 你说", @"好 我要说了", @"噫 你说什么", @"你听不到吗", @"你说什么我都爱你"];
    NSMutableArray *arr = [NSMutableArray array];
    NSMutableArray *array = [NSMutableArray arrayWithArray:title];
    for (int i = 0; i < 5; i++) {
        [arr addObject:[NSString stringWithFormat:@"%d.jpg", i]];
    }
    GXCycleImage *cycy = [[GXCycleImage alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 200)];
    NSString *first = [arr firstObject];
    NSString *last = [arr lastObject];
    [arr insertObject:last atIndex:0];
    [arr addObject:first];

    NSString *fir = [array firstObject];
    NSString *las = [array lastObject];
    [array insertObject:las atIndex:0];
    [array addObject:fir];
    cycy.arrayImage = arr;
    cycy.arrayLabel = array;
    cycy.delaget = self;
    [self.view addSubview:cycy];
 
}
- (void)pressCollectionView
{
    MyViewController *my = [[MyViewController alloc] init];
    [self presentViewController:my animated:YES completion:^{
        
    }];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
